// import request from '@/utils/HttpUtil'
import { getAction, deleteAction, putAction, postAction, httpAction } from '@/api/manage'

export function getByIdApi(id,mode,viewCode) {

    return getAction('/design/getById/'+id+'/'+mode+'/'+viewCode);
    // return getAction({
    //     url: baseUrl+'/design/getById/'+id+'/'+mode+'/'+viewCode,
    //     method: 'get'
    // })
}

export function authViewCodeApi(params) {

    return getAction('/design/authViewCode',params)
    // return request({
    //     url: baseUrl+'/design/authViewCode',
    //     method: 'get',
    //     params
    // })
}

export function uploadFileApi(fileName, data) {
    // return request({
    //     headers: {'Content-Type':'multipart/form-data'},
    //     url: baseUrl+'/file/upload?dir=pre&fileName='+fileName,
    //     method: 'post',
    //     data: data
    // })

    return postAction('/file/upload?dir=pre&fileName='+fileName,data);
}

export function saveOrUpdateApi(data) {
    // return request({
    //     url: baseUrl+'/design/saveOrUpdate',
    //     method: 'post',
    //     data
    // })

    return postAction('/design/saveOrUpdate',data);
}


export function pageListApi(params) {
    // return request({
    //     url: baseUrl+'/design/pageList',
    //     method: 'get',
    //     params
    // })
    return getAction('/design/pageList',params);
}
export function deleteApi(id) {
    // return request({
    //     url: baseUrl+'/design/delete?id='+id,
    //     method: 'delete'
    // })

    return deleteAction('/design/delete?id='+id);
}
